﻿using Godot;
using RPG01.Scripts.SateMachine;

namespace RPG01.Scripts.Character.Player;

public class PlayerJumpState(Player player, StateMachine stateMachine) : State(player, stateMachine)
{
	public override void Enter()
	{
		base.Enter();
		player.Jump();
	}

	public override void PhysicsProcess(double delta)
	{
		base.PhysicsProcess(delta);
		Vector2 moveDirection = player.GetMoveInput();
		player.AddMovement(moveDirection);

		
		if (player.IsOnFloor())
		{
			stateMachine.SwitchState<PlayerIdleState>();
			return;
		}
	}

	
}